Skip to content

Rename CMake target 'executorch' to 'prim_ops_lib' for clarity #11786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JawadKhan65
Copy link

Description

This PR renames the CMake target executorch to prim_ops_lib for better clarity, as the name more accurately reflects its purpose as the library for primitive operations.

Changes:

  • Renamed executorch target to prim_ops_lib in root CMakeLists.txt
  • Added add_library(executorch ALIAS prim_ops_lib) for backward compatibility
  • Updated executorch-config.cmake to call target_link_options_shared_lib(prim_ops_lib)
  • Removed redundant manual calls to target_link_options_shared_lib in examples and backends:
    • examples/models/llava/CMakeLists.txt
    • examples/devtools/CMakeLists.txt
    • extension/android/CMakeLists.txt
    • backends/cadence/CMakeLists.txt
    • examples/models/llama/CMakeLists.txt

Testing:

  • Verified all changes through code inspection
  • Set up a Python virtual environment and installed dependencies
  • Ran the CMake configuration process to verify that the updated targets work correctly
  • Ensured backward compatibility via the alias mechanism

Benefits:

  • Improved clarity in the codebase
  • More accurate naming that reflects the actual purpose of the library
  • Simplified CMake files in examples by relying on the config file for linking options

- Renamed executorch target to prim_ops_lib in CMakeLists.txt
- Added executorch as an alias for backward compatibility
- Updated executorch-config.cmake to use prim_ops_lib
- Removed redundant manual target_link_options_shared_lib calls in examples
- Updated documentation to reflect the new target name
Copy link

pytorch-bot bot commented Jun 18, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11786

Note: Links to docs will display an error until the docs builds have been completed.

❌ 20 New Failures, 4 Unrelated Failures

As of commit 7b207f6 with merge base a0618c8 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

Hi @JawadKhan65!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@JawadKhan65
Copy link
Author

@pytorchbot label "release notes: build"

@pytorch-bot pytorch-bot bot added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Jun 18, 2025
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 18, 2025
Copy link

pytorch-bot bot commented Jun 19, 2025

To add the ciflow label ciflow/trunk please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@JawadKhan65
Copy link
Author

@pytorchbot

@GregoryComer
Copy link
Member

@JawadKhan65 Sorry for the slow response - I know it's a bad look from the framework's perspective. I've triggered CI runs on the PR, and it looks like there are a few remaining tweaks needed. If we can get those resolved, I'll stamp and we can merge it. Thanks!

@GregoryComer
Copy link
Member

Fixes #11761.

Comment on lines +492 to 500
TARGETS prim_ops_lib executorch_core
INCLUDES
DESTINATION ${_common_include_directories}
)
#prim_ops_lib install
install(
TARGETS prim_ops_lib executorch_core
INCLUDES
DESTINATION ${_common_include_directories}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like duplicate? We just need one of the installs

# Find prebuilt libraries. executorch package should contain portable_ops_lib,
# etdump, bundled_program.
find_package(executorch CONFIG REQUIRED)
target_link_options_shared_lib(executorch)
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove this

@@ -37,7 +37,7 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/..)
# Find prebuilt libraries. executorch package should contain portable_ops_lib,
# etdump, bundled_program.
find_package(executorch CONFIG REQUIRED)
target_link_options_shared_lib(executorch)
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -78,7 +78,7 @@ find_package(gflags REQUIRED)
# find `executorch` libraries Same as for gflags
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
find_package(executorch CONFIG REQUIRED)
target_link_options_shared_lib(executorch)
# Note: target_link_options_shared_lib(prim_ops_lib) is now called automatically in executorch-config.cmake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -61,7 +61,10 @@ set_target_properties(fbjni PROPERTIES
)

set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../lib/cmake/ExecuTorch)
target_link_options_shared_lib(executorch)

find_package(executorch CONFIG REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm we don't need this right?

Comment on lines +66 to +67
# target_link_options_shared_lib(executorch) is now handled by executorch-config.cmake

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -56,6 +56,7 @@ endforeach()
set(EXECUTORCH_FOUND ON)

target_link_libraries(executorch INTERFACE executorch_core)
target_link_options_shared_lib(prim_ops_lib)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this to line 177?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants